package com.ml.doctor.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.aspsine.swipetoloadlayout.OnLoadMoreListener;
import com.aspsine.swipetoloadlayout.OnRefreshListener;
import com.aspsine.swipetoloadlayout.SwipeToLoadLayout;
import com.ml.doctor.R;

/**
 * Created by kun on 17/12/5.
 */

public class BaseRefreshLoadFragment extends BaseFragment implements OnRefreshListener, OnLoadMoreListener {
    protected SwipeToLoadLayout swipeToLoadLayout;
    protected ListView swipeTarget;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View viewGroup = inflater.inflate(R.layout.fragment_load_refresh, container, false);
        swipeToLoadLayout = (SwipeToLoadLayout) viewGroup.findViewById(R.id.swipeToLoadLayout);
        swipeTarget = (ListView) viewGroup.findViewById(R.id.swipe_target);
        swipeToLoadLayout.setOnLoadMoreListener(this);
        swipeToLoadLayout.setOnRefreshListener(this);
        initView();
        return viewGroup;
    }


    protected void initView() {
    }

    @Override
    public void onLoadMore() {
    }

    @Override
    public void onRefresh() {
    }
}
